{% block sw_mail_header_footer_list_grid %}
<mt-card
    :title="$tc('sw-mail-header-footer.list.textMailHeaderFooterOverview')"
    position-identifier="sw-mail-header-footer-list"
>

    {% block sw_mail_header_footer_list_grid_empty_state %}
    <sw-empty-state
        v-if="!isLoading && !showListing"
        :title="$tc('sw-mail-header-footer.list.emptyStateTitle')"
        :subline="$tc('sw-mail-header-footer.list.emptyStateSubTitle')"
        :absolute="false"
    >

        {% block sw_mail_header_footer_list_grid_empty_state_icon %}
        <template #icon>
            <img
                :src="assetFilter('/administration/administration/static/img/empty-states/settings-empty-state.svg')"
                :alt="$tc('sw-mail-header-footer.list.emptyStateTitle')"
            >
        </template>
        {% endblock %}

    </sw-empty-state>
    {% endblock %}

    {% block sw_mail_template_list_grid %}
    <template #grid>
        <sw-entity-listing
            v-if="isLoading || showListing"
            id="mailHeaderFooterGrid"
            ref="listing"
            class="sw-mail-templates-list-grid"
            detail-route="sw.mail.template.detail_head_foot"
            identifier="sw-mail-header-footer-list"
            :items="mailHeaderFooters"
            :columns="getListColumns()"
            :repository="mailHeaderFooterRepository"
            :full-page="false"
            :is-loading="isLoading"
            :allow-view="acl.can('mail_templates.viewer')"
            :allow-edit="acl.can('mail_templates.editor')"
            :allow-delete="acl.can('mail_templates.deleter')"
            :show-selection="acl.can('mail_templates.deleter') || undefined"
            :skeleton-item-amount="skeletonItemAmount"
            @update-records="updateRecords"
        >
            <template #column-salesChannels.name="{ item }">
                {% block sw_mail_template_list_columns_sales_channels_label %}
                {{ getSalesChannelsString(item) }}
                {% endblock %}
            </template>

            <template #bulk-modal-delete-items>
                <mt-button
                    variant="critical"
                    size="small"
                    @click="onMultipleDelete"
                >
                    {{ $tc('global.default.delete') }}
                </mt-button>
            </template>

            <template #delete-modal-delete-item="{ item }">
                <mt-button
                    variant="critical"
                    size="small"
                    @click="onDelete(item)"
                >
                    {{ $tc('global.default.delete') }}
                </mt-button>
            </template>

            <template #more-actions="{ item }">
                {% block sw_mail_header_footer_list_grid_columns_actions_duplicate %}
                <sw-context-menu-item
                    class="sw-mail-header-footer-list-grid__duplicate-action"
                    :disabled="!acl.can('mail_templates.creator') || undefined"
                    @click="onDuplicate(item.id)"
                >
                    {{ $tc('sw-mail-header-footer.list.contextMenuDuplicate') }}
                </sw-context-menu-item>
                {% endblock %}
            </template>
        </sw-entity-listing>
    </template>
    {% endblock %}

</mt-card>
{% endblock %}
